<include file="App/Home/View/default/Public/header.html"/>
  <link href="__PUBLIC__/css/category.css" rel="stylesheet" media="screen">
	<div class="container">
      <div class="row">
        <div class="">
          <div id="sub-nav" class="col-md-12">
            <div class="primary-categories">
                <div class="ui-select">
                    <span class="ui-select-label" data-value="{$cate_info.id}">{$cate_info.cate_name}<i class="fa fa-caret-down"></i></span>
                    <ul class="ui-select-options">
                        <!-- <li data-value="1"><a href="/category/nvzhuang/">女装</a></li>
                        <li data-value="50"><a href="/category/nvxie/">女鞋</a></li>
                        <li data-value="83"><a href="/category/nanzhuang/">男装</a></li>
                        <li data-value="110"><a href="/category/nanxie/">男鞋</a></li>
                        <li data-value="137"><a href="/category/xiangbao/">箱包</a></li>
                        <li data-value="184"><a href="/category/peishi/">配饰</a></li>
                        <li data-value="222"><a href="/category/jiajuzhuangshi/">家居装饰</a></li>
                        <li data-value="349"><a href="/category/meizhuang/">美妆</a></li>
                        <li data-value="398"><a href="/category/meishi/">美食</a></li>
                        <li data-value="437"><a href="/category/shuma/">数码</a></li>
                        <li data-value="476"><a href="/category/huwai_yundong/">户外/运动</a></li>
                        <li data-value="598"><a href="/category/liwu/">礼物</a></li>
                        <li data-value="607"><a href="/category/riyongbaihuo/">日用百货</a></li> -->
                    </ul>
                </div>
            </div>
            <div class="secondary-categories layout-54 row">
                <div class="column column-hot col-md-3">
                    <div class="column secondary-category hot">
                        <span class="secondary-category-name">热门</span>
                        <ul class="tertiary-category-items">
                            <li class="tertiary-category-item">
                                <a href="javascript:;">日系</a>
                            </li>
                            <li class="tertiary-category-item">
                                <a href="javascript:;">外贸原单</a>
                            </li>
                            <li class="tertiary-category-item">
                                <a href="javascript:;">衬衫</a>
                            </li>
                            <li class="tertiary-category-item">
                                <a href="javascript:;">卫衣</a>
                            </li>
                            <li class="tertiary-category-item">
                                <a href="javascript:;">外套</a>
                            </li>
                            <li class="tertiary-category-item">
                                <a href="javascript:;">西装</a>
                            </li>
                            <li class="tertiary-category-item">
                                <a href="javascript:;">牛仔裤</a>
                            </li>
                        </ul>
                    </div>
                </div>
                <?php
                  $start = 0;
                  $page = 3;
                  $count = ceil(count($sub_nav) / 3);
                  for ($i=1; $i <= $count; $i++) { 
                    $max = $i*$page;
                    echo "<div class='column col-md-9'>"
                            ."<div class='cate-row row'>";
                    foreach ($sub_nav as $k => $v) {
                      if ($k >= $start && $k <$max) {
                       echo "<div class='column secondary-category col-md-4'>"
                               ."<span class='secondary-category-name'>".$v['cate_name']."</span>";
                       if (isset($v['child']) && count($v['child'])) {
                         echo "<ul class='tertiary-category-items'>";
                         foreach ($v['child'] as $kk => $vv) {
                           echo "<li class='tertiary-category-item'>"
                                 ."<a href='".$vv['id']."'>".$vv['cate_name']."</a></li>";
                         }
                         echo "</ul>";
                       }
                       echo "</div>";
                      }
                    }
                    $start = $max;
                    echo "</div></div>";
                  }
                ?>
            </div>
            <div class="toggle-category">
                <a href="javascript:;" class="js-toggle toggle-full">查看全部分类<i class="fa fa-caret-down"></i></a>
                <a href="javascript:;" class="js-toggle toggle-part hidden">收起全部<i class="fa fa-caret-up"></i></a>
            </div>
          </div>
        </div>  
      </div>
    </div>
    <div class="container">
      <div class="row food_con">
        <foreach name='goods_list' item="goods">
          <?php
            $path = "Public/Uploads/";
            list($width, $height) = getimagesize($path.$goods['cover']);
            if ($height > 203) {
              $gap = $height - 203;
              $style = 'margin-top:'.(-$gap/2)."px";
            }
          ?>
          <div class="col-md-4 col-sm-6">
            <div class="card-item">
              <div class="card-main">
                <div class="card-hd">
                  <div class="img">
                      <!-- <span class="price-icon free">
                        免费
                      </span> -->
                      <a href="{:U('goods/'.$goods['id'])}">
                        <img class="img-responsive" src="__PUBLIC__/Uploads/{$goods.cover}" style="<?php echo $style;?>">
                      </a>
                    </div>
                    <span class="commodity-price">￥{$goods.cost_price}</span>
                </div>
                <div class="card-bd">
                  <h2 class="story-title" title="{$goods.title}">
                      <a target="_blank" href="{:U('goods/'.$goods['id'])}">{$goods.title}</a>
                  </h2>
                  <div class="author-box">
                    <a class="author-avatar-link" href="#">
                        <img width="24" height="24" src="__PUBLIC__/images/avatar_5.jpg" alt="哇礼" title="哇礼">
                    </a>
                    <a href="#">哇礼小编</a>&nbsp;发布
                  </div>
                  <div class="story-quote">
                      <q class="quote">{$goods.why_recommend|default="Ta暂时还没有写推荐语"}</q>
                  </div>
                  <div class="story-info" data-eqid="3878709">
                      <ul class="stats-list">
                          <li class="doulist-count">加入抽屉&nbsp;{$goods.add2drawer_count}</li>
                          <li class="like">喜欢&nbsp;{$goods.like_count}</li>
                          <li class="post">评论&nbsp;{$goods.commnet_count}</li>
                      </ul>
                  </div>
                </div>    
              </div>
              <div class="card-extra">
                <div class="card-actions" style="display: none;">
                  
                </div>
              </div>
            </div>
          </div>
        </foreach>        
      </div>
    </div>
<include file="App/Home/View/default/Public/footer.html"/>